/*
 * Copyright ®2018 juneyaoair Group.
 *
 *
 *
 */
 
package ${classPackage};

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
<#if importPackage?exists>
	<#list importPackage as table>
import ${table};
	</#list>
</#if>

/**
 * ${classComment}
 *
 * @author ${author}
 * @date ${.now}
 */
@Data
@ToString
@EqualsAndHashCode(callSuper=false)
@JsonInclude(Include.NON_NULL)
public class ${className} <#if baseDtoRule>extends ${parentClass}</#if> {

    <#list attrList as attr>
    /** ${attr.comment} ${attr.commentDesc} */
    @ApiModelProperty(value="${attr.comment}")
    @JsonProperty(value="${attr.name}")
    private ${attr.type} ${attr.attrName};
    </#list>
    
    <#if className?ends_with("ResponseDto")>
    /**
     * 默认构造方法
     */
    public ${className}() {
    	super();
    }
    
    /**
     * 根据请求参数新建返回结果
     *
     * @param request 请求参数
     */
    public ${className}(${className?replace("ResponseDto", "")}RequestDto request) {
    	super(request);
    	<#list attrList as attr>
    	<#if attr.constParam>
    	this.${attr.attrName} = request.get${attr.name}();
        </#if>
    	</#list>
    }
    </#if>
}